package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.MarketProductType;
import com.rockcent.mall.lib.domain.enumclass.ProductType;
import com.rockcent.mall.lib.domain.enumclass.TerminalType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2016/10/27.
 */
@Entity
@Table(name = "page_viewed")
@DynamicInsert
@DynamicUpdate
public class PageViewed extends IDEntityMall {
    @Column(columnDefinition = "varchar(255) comment'渠道ID'",name = "channel")
    private String channelId;
    @Column(columnDefinition = "bigint comment'平台ID'")
    private Long mallId;
    @Column(columnDefinition = "varchar(255) comment'页面名称'")
    private String pageName;
    @Column(columnDefinition = "varchar(255) comment'页面URL'")
    private String pageUrl;
    @Column(columnDefinition = "varchar(255) comment'访问者IP'")
    private String visitip;
    @Column(columnDefinition = "varchar(255) comment'分销市场属性 SOURCE(\"源\"),TARGET(\"目标\")'")
    private MarketProductType marketProductType;
    @Column(columnDefinition = "bigint comment'商铺ID'")
    private Long merchantId;
    @Column(columnDefinition = "bigint comment'产品ID'")
    private Long productId;
    @Column(columnDefinition = "varchar(255) comment'产品类型'")
    @Enumerated(EnumType.STRING)
    private ProductType productType;
    @Column(columnDefinition = "varchar(255) comment'终端类型 WECHAT , IOS  , ANDROID , BROWER, MERCHANT'")
    @Enumerated(EnumType.STRING)
    private TerminalType fromTerminal = TerminalType.WECHAT;

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getPageName() {
        return pageName;
    }

    public void setPageName(String pageName) {
        this.pageName = pageName;
    }

    public String getPageUrl() {
        return pageUrl;
    }

    public void setPageUrl(String pageUrl) {
        this.pageUrl = pageUrl;
    }

    public String getVisitip() {
        return visitip;
    }

    public void setVisitip(String visitip) {
        this.visitip = visitip;
    }

    public MarketProductType getMarketProductType() {
        return marketProductType;
    }

    public void setMarketProductType(MarketProductType marketProductType) {
        this.marketProductType = marketProductType;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public ProductType getProductType() {
        return productType;
    }

    public void setProductType(ProductType productType) {
        this.productType = productType;
    }

    public TerminalType getFromTerminal() {
        return fromTerminal;
    }

    public void setFromTerminal(TerminalType fromTerminal) {
        this.fromTerminal = fromTerminal;
    }

    @Override
    public String toString() {
        return "PageViewed{" +
                "id=" + id +
                ", channelId='" + channelId + '\'' +
                ", mallId=" + mallId +
                ", dateCreated=" + dateCreated +
                ", pageName='" + pageName + '\'' +
                ", lastUpdated=" + lastUpdated +
                ", pageUrl='" + pageUrl + '\'' +
                ", visitip='" + visitip + '\'' +
                ", isDelete=" + isDelete +
                ", version=" + version +
                ", marketProductType=" + marketProductType +
                ", merchantId=" + merchantId +
                ", productId=" + productId +
                ", productType=" + productType +
                ", fromTerminal=" + fromTerminal +
                '}';
    }
}
